package com.supcon.exchangedata.repository.slave4;


import com.supcon.exchangedata.pojo.entity.mysql.operation.gj.TBusDailyAmount;
import com.supcon.exchangedata.pojo.entity.mysql.operation.sw.WaterDailyOpertionInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *   公交日运营数据
 * @Author: yangbin
 * @Date: 2022/04/20/9:00
 * @Description:
 */
public interface SlaveGjOperationInfo extends JpaRepository<TBusDailyAmount, Long> {


    @Transactional
    @Query(nativeQuery = true, value = "SELECT * FROM t_bus_daily_amount WHERE date_time = (SELECT MAX(date_time) FROM t_bus_daily_amount)")
    List<TBusDailyAmount> findTopData();

    List<TBusDailyAmount> findAllByDateTimeBetween(LocalDateTime startTime, LocalDateTime endTime);


}
